<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;
use App\Middleware\Auth\PermissionMiddleware;

Router::get('/login', 'App\Controller\LoginController@index');
Router::post('/login', 'App\Controller\LoginController@doLogin');
Router::get('/logout', 'App\Controller\LoginController@logout');

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index', ['middleware' => [PermissionMiddleware::class]]);

Router::addRoute(['GET', 'POST', 'HEAD'], '/crowd', 'App\Controller\CrowdController@index', ['middleware' => [PermissionMiddleware::class]]);

Router::addRoute(['GET', 'POST', 'HEAD'], '/products', 'App\Controller\ProductController@index', ['middleware' => [PermissionMiddleware::class]]);

Router::get('/favicon.ico', function () {
    return '';
});
